package com.smfx.yxt.view;

import java.util.Date;
import java.util.Map;

import org.apache.commons.lang.StringUtils;

import com.smfx.yxt.common.Const;
import com.smfx.yxt.wechat.utils.WechatGlobalMap;

public class ExamGroupView {

	private String examKey;
	
	private String examName; 
	
	private Integer termId;
	
	private String termName; 
	
	private Date regClosingTime; 
	
	private Date examTime;
	
	private String gradeIds;

	public String getExamKey() {
		return examKey;
	}

	public void setExamKey(String examKey) {
		this.examKey = examKey;
	}

	public String getExamName() {
		return examName;
	}

	public void setExamName(String examName) {
		this.examName = examName;
	}

	public Integer getTermId() {
		return termId;
	}

	public void setTermId(Integer termId) {
		this.termId = termId;
	}

	public String getTermName() {
		return termName;
	}

	public void setTermName(String termName) {
		this.termName = termName;
	}

	public Date getRegClosingTime() {
		return regClosingTime;
	}

	public void setRegClosingTime(Date regClosingTime) {
		this.regClosingTime = regClosingTime;
	}

	public Date getExamTime() {
		return examTime;
	}

	public void setExamTime(Date examTime) {
		this.examTime = examTime;
	}

	public String getGradeIds() {
		return gradeIds;
	}

	public void setGradeIds(String gradeIds) {
		this.gradeIds = gradeIds;
	}
	
	public String getGradeNames() {
		if(StringUtils.isNotBlank(this.gradeIds)) {
			String gradeNames = "";
			Map<Integer, String> map = (Map<Integer, String>)WechatGlobalMap.get(Const.CACHE_GRADE).getValue();
			String[] array = this.gradeIds.split(",");
			for(int i = 0; i < array.length; i++){
				gradeNames += map.get(Integer.valueOf(array[i])) + 
						((i+1) < array.length ? "," : "");
			}
			return gradeNames;
		}
		return "";
	}

}
